package com.kratos.designdemo.service.impl;

import com.kratos.designdemo.controller.vo.OrderVo;
import com.kratos.designdemo.entity.Order;
import com.kratos.designdemo.enums.OrderStatusEnum;
import com.kratos.designdemo.service.OrderStatusAbstract;
import com.kratos.designdemo.service.OrderStatusService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author kratos
 * @date 2022-06-09 14:19:59
 */
@Service
@Slf4j
public class WaitPayImpl extends OrderStatusAbstract implements OrderStatusService {
    @Override
    public boolean support(OrderVo orderVo) {

        return orderVo.getStatus().equals(OrderStatusEnum.WAIT_PAY.getCode());
    }

    @Override
    public void update(OrderVo orderVo) {
        this.waitPay(orderVo);
    }

    @Override
    public void waitPay(OrderVo orderVo) {

        Order order = super.check(orderVo);
        log.info("处理订单待支付业务...........");
    }
}
